nrc.fuzzy
Class FuzzyValue

java.lang.Object
  |
  +--nrc.fuzzy.FuzzyValue
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class FuzzyValue
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

The FuzzyValue class represents a fuzzy value, which is an association of a FuzzyVariable, a FuzzySet, and the linguistic expression which describe the FuzzyValue.

The FuzzyVariable provides a set of Terms that can be used to describe concepts being developed for the variable. For example, temperature may be a fuzzy variable, with terms such as hot, cold and warm being used to describe concepts such as 'hot or cold'.

The linguistic expression is formed using the terms of the FuzzyVariable along with the operators 'or' and 'and' and the set of supplied modifiers such as 'very', 'not' and 'slightly'. These english-like expressions are used to describe the required fuzzy concepts for the variable.

For example, let us consider the FuzzyVariable temperature, with terms cold, warm, and hot. It is decided that we would like a FuzzyValue that represents the concept "slightly cold AND warm" for the temperature variable. This string is parsed, and based on the parse a suitable FuzzySet is created for the FuzzyValue, and the linguistic expression is stored as "slightly cold AND warm". See the documentation for the FuzzyScanner class for more detailed information on the grammar and parsing.

However, it is also possible to create a FuzzyValue by providing the data it requires to create its FuzzySet. It this case, no linguistic expression has been used, and the linguisticExpression is assigned the default String value which, unless changed, is "???".

The FuzzySet in a FuzzyValue contains a set of points. This set of points is the mathematical representation of the fuzzy concept being expressed for this FuzzyValue.

The code below shows the creation of a FuzzyVariable and a FuzzyValue:


    double xHot[] = {25, 35};
    double yHot[] = {0, 1};
    double xCold[] = {5, 15};
    double yCold[] = {1, 0};
    FuzzyValue fval = null;
    ...
    FuzzyVariable temp = new FuzzyVariable("temperature", 0, 100, "C");
    ...
    temp.addTerm("hot", xHot, yHot, 2);
    temp.addTerm("cold", xCold, yCold, 2);
    // note: once a term is added it can be used to define other terms
    temp.addTerm("medium", "not hot and not cold");
    ...
    fval = new FuzzyValue(temp, "very hot or cold");
    System.out.println(fval);
 
The output from this would be:

 FuzzyVariable         -> temperature [ 0.0, 100.0 ] C
 Linguistic Expression -> very hot or cold
 FuzzySet              -> { 1/5 0/15 0/25 0.01/26 0.04/27 0.09/28 0.16/29 0.25/30
                            0.36/31 0.49/32 0.64/33 0.81/34 1/35  } 
 

NOTE: Although the range of allowed membership values is [0, 1], it is possible to form FuzzySets of FuzzyValues with membership values > 1.0. There are instances where this is desirable. For example in some approaches it is preferred to collect the outputs of fuzzy rules by doing a 'fuzzySum' of the resultant FuzzyValues (global contribution of rules). The fuzzySum operation can result in FuzzySets with membership values > 1.0. When a FuzzyValue is created with a FuzzyValue constructor (that does not use an existing FuzzyValue or an existing FuzzySet) the values are restricted to being between 0 and 1. However, the fuzzySum operation and the FuzzySet methods appendSetPoint and insertSetPoint can be used to override this restriction.

See Also:
FuzzyVariable, FuzzySet, FuzzyScanner, Serialized Form

Constructor Summary
FuzzyValue(nrc.fuzzy.FuzzyValue fuzzyValue)
          Constructs a new FuzzyValue object from an existing FuzzyValue.
FuzzyValue(nrc.fuzzy.FuzzyVariable fuzzyVariable, double[] x, double[] y, int numPoints)
          Constructs a new FuzzyValue object which has a reference to the FuzzyVariable argument and creates a FuzzySet from the two arrays of double values.
FuzzyValue(nrc.fuzzy.FuzzyVariable fuzzyVariable, nrc.fuzzy.FuzzySet fuzzySet)
          Constructs a new FuzzyValue object which has a reference to the FuzzyVariable argument and which contains the FuzzySet argument.
FuzzyValue(nrc.fuzzy.FuzzyVariable fuzzyVariable, nrc.fuzzy.SetPoint[] setPoints, int numPoints)
          Constructs a new FuzzyValue object which has a reference to the FuzzyVariable argument and creates a FuzzySet from the array of SetPoints.
FuzzyValue(nrc.fuzzy.FuzzyVariable fuzzyVariable, java.lang.String linguisticExpression)
          Constructs a FuzzyValue with the fuzzyVariable variable set equal to the FuzzyVariable argument, and the linguisticExpression variable initialized to the passed linguistic expression String argument.
 
Method Summary
 void assignFuzzySet(nrc.fuzzy.FuzzySet fuzzySet)
          Assigns a new FuzzySet to the FuzzyValue.
 void binaryModifyLinguisticExpression(java.lang.String op, java.lang.String oldLinguisticExpression1, java.lang.String oldLinguisticExpression2)
          Modifies the linguistic expression when a binary operation (such union or intersection) of 2 fuzzy values is done to produce a new fuzzy value.
 nrc.fuzzy.FuzzyValue copyFuzzyValue()
          Returns a copy of this FuzzyValue.
 boolean equals(java.lang.Object v)
          Compare two FuzzyValues for a fuzzy equality.
 boolean equalsStar(java.lang.Object v)
          Compare two FuzzyValues for a more precise equality.
 nrc.fuzzy.FuzzyValue fuzzyComplement()
          Takes the complement of the FuzzyValue.
 nrc.fuzzy.FuzzyValue fuzzyIntersection(nrc.fuzzy.FuzzyValue otherValue)
          Perform the fuzzy intersection of 2 fuzzy values.
 nrc.fuzzy.FuzzyValue fuzzyIntersection(java.lang.String linguisticExpression)
          Perform the fuzzy intersection of 2 fuzzy values.
 boolean fuzzyMatch(nrc.fuzzy.FuzzyValue otherValue)
          Determine if 2 FuzzyValues 'match' or intersect with a membership of at least that specified by the FuzzyValue class variable matchThreshold.
 boolean fuzzyMatch(nrc.fuzzy.FuzzyValue otherValue, double threshold)
          Determine if 2 FuzzyValues 'match' or intersect with a membership of at least that specified by parameter threshold.
 boolean fuzzyMatch(java.lang.String linguisticExpression)
          Determine if 2 FuzzyValues 'match' or intersect with a membership of at least that specified by the FuzzyValue class variable matchThreshold.
 boolean fuzzyMatch(java.lang.String linguisticExpression, double threshold)
          Determine if 2 FuzzyValues 'match' or intersect with a membership of at least that specified by parameter 'threshold'.
 nrc.fuzzy.FuzzyValue fuzzyNormalize()
          Normalizes the FuzzyValue.
 nrc.fuzzy.FuzzyValue fuzzyScale(double y)
          Scale this FuzzyValue.
 nrc.fuzzy.FuzzyValue fuzzySum(nrc.fuzzy.FuzzyValue otherValue)
          Returns the sum of this FuzzyValue with the FuzzyValue argument.
 nrc.fuzzy.FuzzyValue fuzzySum(java.lang.String linguisticExpression)
          Returns the sum of this FuzzyValue with the FuzzyValue argument.
 nrc.fuzzy.FuzzyValue fuzzyUnion(nrc.fuzzy.FuzzyValue otherValue)
          Perform the fuzzy union of 2 fuzzy values.
 nrc.fuzzy.FuzzyValue fuzzyUnion(java.lang.String linguisticExpression)
          Perform the fuzzy union of 2 fuzzy values.
 nrc.fuzzy.IntervalVector getAlphaCut(boolean cutType, double alpha)
          Returns the alpha cut of the FuzzyValue at the membership level specified by the alpha argument.
 nrc.fuzzy.FuzzySet getFuzzySet()
          Returns the FuzzySet that is contained within this FuzzyValue.
 nrc.fuzzy.FuzzyVariable getFuzzyVariable()
          Returns the FuzzyVariable to which this FuzzyValue belongs.
 java.lang.String getLinguisticExpression()
          Returns the String which represents the linguistic expression of this FuzzyValue.
static double getMatchThreshold()
          Returns the current matchThreshold which is used when comparing fuzzy values with the fuzzyMatch method.
 double getMaxUOD()
          Returns the x value which represents the maximum x value in the Universe of Discourse of the FuzzyVariable to which this FuzzyValue belongs, and therefore the maxinum x value of the Universe of Discourse of this FuzzyValue.
 double getMaxY()
          Returns the maximum membership value of the FuzzySet.
 double getMembership(double x)
          Returns the membership value of the FuzzyValue at the specified x value.
 double getMinUOD()
          Returns the x value which represents the minimum x value in the Universe of Discourse of the FuzzyVariable to which this FuzzyValue belongs, and therefore the mininum x value of the Universe of Discourse of this FuzzyValue.
 double getMinY()
          Returns the minimum membership value of the FuzzySet.
 nrc.fuzzy.IntervalVector getSupport()
          Returns the support of this FuzzyValue.
 java.lang.String getUnits()
          Returns the units of the FuzzyVariable to which this FuzzyValue belongs, and therefore the units of this FuzzyValue.
 double getX(int index)
          Returns the x value of the point in the FuzzyValue at the specified index.
 double getXforMembership(double m)
          Returns the 1st X value with the specified membership value in the FuzzySet This is done by interpolation.
 double getY(int index)
          Returns the y value of the point in the FuzzyValue at the specified index.
 int hashCode()
          Return a hashcode value for the FuzzyValue.
 nrc.fuzzy.FuzzyValue horizontalIntersection(double y)
          Returns the horizontal intersection of the FuzzyValue at the membership level specified by the y parameter.
 nrc.fuzzy.FuzzyValue horizontalUnion(double y)
          Returns the horizontal union of the FuzzySet at the membership level specified by the y parameter.
 boolean isAnyXValueOutsideUOD(nrc.fuzzy.FuzzySet fs, nrc.fuzzy.FuzzyVariable fvar)
          Checks to see if all of the X values of a fuzzy set are within the range of the universe of discourse (UOD) of a fuzzy variable.
static boolean isConfineFuzzySetsToUOD()
          Returns true if FuzzySets will be confined to lie within the Universe of Discourse (UOD) when FuzzyValues are constructed.
 boolean isConvex()
          Returns true if this FuzzyValue is convex.
 boolean isEmpty()
          Returns true if this FuzzyValue is empty; in other words, if this FuzzyValue has a null FuzzySet, or a FuzzySet which doesn't contain any points.
 boolean isNormal()
          Returns true if this FuzzyValue is normal.
 boolean isXValueOutsideUOD(double x, nrc.fuzzy.FuzzyVariable fvar)
          Returns true if the x value passed to the method is outside of the Universe of Discourse.
 double maximumDefuzzify()
          Finds the mean of maxima of a fuzzy set as the defuzzification value.
 double maximumOfIntersection(nrc.fuzzy.FuzzyValue otherValue)
          Find the minimum membership values between 2 FuzzyValues at all x values and then find the maximum of these minimums (in effect take the intersection of the 2 FuzzyValues and find the maximum membership value of this).
 double maximumOfIntersection(java.lang.String linguisticExpression)
          Find the minimum membership values between 2 FuzzyValues at all x values and then find the maximum of these minimums (in effect take the intersection of the 2 FuzzyValues and find the maximum membership value of this).
 double momentDefuzzify()
          Moment defuzzification defuzzifies a fuzzy set returning a floating point (double value) that represents the fuzzy set.
 java.lang.String plotFuzzyValue(java.lang.String plotChar)
          Plots the fuzzy value in an ascii format producing a String that can be displayed.
 java.lang.String plotFuzzyValue(java.lang.String plotChar, double lowX, double highX)
          Plots the fuzzy value in an ascii format producing a String that can be displayed.
static java.lang.String plotFuzzyValues(java.lang.String plotChars, double lowX, double highX, nrc.fuzzy.FuzzyValue[] fvals)
          Plots the fuzzy values in an ascii format producing a String that can be displayed.
static java.lang.String plotFuzzyValues(java.lang.String plotChars, nrc.fuzzy.FuzzyValue[] fvals)
          Plots the given fuzzy values in an ascii format producing a String that can be displayed.
static void setConfineFuzzySetsToUOD(boolean b)
          If param is true FuzzySets will be confined to lie within the Universe of Discourse (UOD) when FuzzyValues are constructed.
 void setLinguisticExpression(java.lang.String lexpr)
          Sets the String which represents the linguistic expression of this FuzzyValue.
static void setMatchThreshold(double value)
          Sets the current default matchThreshold which is used when comparing fuzzy values with the fuzzyMatch method.
 double similarity(nrc.fuzzy.FuzzyValue fv)
          SIMILARITY: similarity measure of two fuzzy sets Given two fuzzy values, f1 and f2, similarity is defined as:
 int size()
          Returns the size of the FuzzyValue; in other words, the number of points contained in the FuzzySet.
 java.lang.String toString()
          Returns the String representation of the FuzzyValue.
 void unaryModifyLinguisticExpression(java.lang.String operator, java.lang.String oldLinguisticExpression)
          Modifies the linguistic expression when a unary operation (such as very, more_or_less, etc.) is applied to produce a new fuzzy value.
 double weightedAverageDefuzzify()
          Finds the weighted average of the values of a fuzzy set as the defuzzification value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FuzzyValue

public FuzzyValue(nrc.fuzzy.FuzzyVariable fuzzyVariable,
                  java.lang.String linguisticExpression)
           throws InvalidLinguisticExpressionException
Constructs a FuzzyValue with the fuzzyVariable variable set equal to the FuzzyVariable argument, and the linguisticExpression variable initialized to the passed linguistic expression String argument.

To initialize the FuzzySet of the FuzzyValue, the linguistic expression argument is parsed and the respective modifiers and operators are applied to the FuzzyValue terms refered to in the linguistic expression. The result of the modifier application and operations is then assigned to the FuzzySet of this FuzzyValue.

Parameters:
fuzzyVariable - the FuzzyVariable that the FuzzyValue belongs to, or is defined in terms of.
linguisticExpression - the linguistic expression defining the FuzzySet. It is important that the linguistic expression parameter contains no ambiguities in intention. For example, the String "not cold AND very warm" could be interpreted as either "(not cold) AND (very warm)", or "not (cold AND very warm)". The use of parentheses is of utmost importance, as the absence of parentheses required to prevent ambiguities in meaning will lead to unpredictable results.

The parsing of the linguistic expression results in the specified modifiers and operators applied to the specified terms. The end product is the FuzzySet that belongs to the new FuzzyValue.

Throws:
InvalidLinguisticExpressionException - if the parse/evaluation of the linguistic expression fails

FuzzyValue

public FuzzyValue(nrc.fuzzy.FuzzyVariable fuzzyVariable,
                  nrc.fuzzy.FuzzySet fuzzySet)
           throws XValueOutsideUODException
Constructs a new FuzzyValue object which has a reference to the FuzzyVariable argument and which contains the FuzzySet argument. Because the FuzzySet is already in existence when the FuzzyValue is created, a linguistic expression is not required to build the FuzzySet. Therefore, there is no reference which defines the FuzzySet linguistically, and as a result the linguistic expression of a FuzzyValue constructed in this a manner will be the default linguistic expression, ie. "???".

Parameters:
fuzzyVariable - the FuzzyVariable that the FuzzyValue belongs to, or is defined in terms of.
fuzzySet - the FuzzySet to be assigned to the FuzzyValue
Throws:
XValueOutsideUODException - if the fuzzy set x values are not within the range of the universe of discourse

FuzzyValue

public FuzzyValue(nrc.fuzzy.FuzzyValue fuzzyValue)
Constructs a new FuzzyValue object from an existing FuzzyValue. This is basically a copy.

Parameters:
fuzzyValue - the FuzzyValue to copy range of the universe of discourse

FuzzyValue

public FuzzyValue(nrc.fuzzy.FuzzyVariable fuzzyVariable,
                  double[] x,
                  double[] y,
                  int numPoints)
           throws XValuesOutOfOrderException,
                  YValueOutOfRangeException,
                  XValueOutsideUODException
Constructs a new FuzzyValue object which has a reference to the FuzzyVariable argument and creates a FuzzySet from the two arrays of double values. Because the FuzzySet is created from double arrays, a linguistic expression is not required to build the FuzzySet. Therefore, there is no reference which defines the FuzzySet linguistically, and as a result the linguistic expression of a FuzzyValue constructed in this a manner will be the default linguistic expression, ie. "???".

Parameters:
fuzzyVariable - the FuzzyVariable that the FuzzyValue belongs to, or is defined in terms of.
x - the double array containing the x values of the points that are to constitute the FuzzySet.
y - the double array containing the y values of the points that are to constitute the FuzzySet.
numPoints - the number of points that are contained within the two arrays. In other words, it would be logically expected that the length of the x values array would be equal to the y values array, which would also be equal to the number of points that are to be inserted into the FuzzySet.
Throws:
XValuesOutOfOrderException - if the x values in the x double array are not in strictly ascending order.
YValueOutOfRangeException - if the y values are not within the range [0.0, 1.0]
XValueOutsideUODException - if the fuzzy set x values are not within the range of the universe of discourse

FuzzyValue

public FuzzyValue(nrc.fuzzy.FuzzyVariable fuzzyVariable,
                  nrc.fuzzy.SetPoint[] setPoints,
                  int numPoints)
           throws XValuesOutOfOrderException,
                  YValueOutOfRangeException,
                  XValueOutsideUODException
Constructs a new FuzzyValue object which has a reference to the FuzzyVariable argument and creates a FuzzySet from the array of SetPoints. Because the FuzzySet is created from a SetPoint array, a linguistic expression is not required to build the FuzzySet. Therefore, there is no reference which defines the FuzzySet linguistically, and as a result the linguistic expression of a FuzzyValue constructed in this a manner will be the default linguistic expression, ie. "???".

Parameters:
fuzzyVariable - the FuzzyVariable that the FuzzyValue belongs to, or is defined in terms of.
setPoints - the array of SetPoints that are to constitute the FuzzySet.
numPoints - the number of points that are contained in the SetPoint array.
Throws:
XValuesOutOfOrderException - if the x values in the x double array are not in strictly ascending order.
YValueOutOfRangeException - if the y values are not within the range [0.0, 1.0]
XValueOutsideUODException - if the fuzzy set x values are not within the range of the universe of discourse
Method Detail

equals

public boolean equals(java.lang.Object v)
Compare two FuzzyValues for a fuzzy equality. To be 'equal' then the two FuzzyValues must have the same FuzzyVariable. Note that this 'definition' of equality is useful in some contexts, especially with FuzzyJess. Other definitions are possible but this will not be changed. Instead we provide an equalsStar method to do a more precise comparison. Many specific needs might arise and the user can define others as required.

Overrides:
equals in class java.lang.Object
Parameters:
v - the object to compare to the FuzzyValue.
Returns:
true if the FuzzyValues are associated with the same FuzzyVariable.

equalsStar

public boolean equalsStar(java.lang.Object v)
Compare two FuzzyValues for a more precise equality. To be equal then the two FuzzyValues must have the same FuzzyVariable and the two fuzzy sets must be equal (see equals method for FuzzySets.

Parameters:
v - the object to compare to the FuzzyValue.
Returns:
true if the FuzzyValues are associated with the same FuzzyVariable and the FuzzySets of the FuzzyValues are also equal.
See Also:
FuzzySet

hashCode

public int hashCode()
Return a hashcode value for the FuzzyValue.

Overrides:
hashCode in class java.lang.Object
Returns:
an integer hashCode value determined by the FuzzyVariable associated with the FuzzyValue. This is consistent with equals method.

copyFuzzyValue

public nrc.fuzzy.FuzzyValue copyFuzzyValue()
                                    throws java.lang.CloneNotSupportedException
Returns a copy of this FuzzyValue.

Returns:
a new FuzzyValue object which is the copy of this FuzzyValue.
Throws:
java.lang.CloneNotSupportedException - if this class does not implement the Cloneable interface (which it does, so don't worry about it).

unaryModifyLinguisticExpression

public void unaryModifyLinguisticExpression(java.lang.String operator,
                                            java.lang.String oldLinguisticExpression)
Modifies the linguistic expression when a unary operation (such as very, more_or_less, etc.) is applied to produce a new fuzzy value. If the linguistic expression is the default linguistic expression (for unknown linguistic values -- normally ???) then just leave it as the default linguistic expression.

Parameters:
operator - the operator (very, more_or_less, etc.) that was applied
oldLinguisticExpression - the linguistic expression from the fuzzy value that was modified

binaryModifyLinguisticExpression

public void binaryModifyLinguisticExpression(java.lang.String op,
                                             java.lang.String oldLinguisticExpression1,
                                             java.lang.String oldLinguisticExpression2)
Modifies the linguistic expression when a binary operation (such union or intersection) of 2 fuzzy values is done to produce a new fuzzy value. If either of the linguistic expressions is the default linguistic expression (for unknown linguistic values -- normally ???) then just set if to the default linguistic expression.

Parameters:
op - the operator (and, or, etc.) that was applied
oldLinguisticExpression1 - the linguistic expression from the 1st fuzzy value
oldLinguisticExpression2 - the linguistic expression from the 2nd fuzzy value

assignFuzzySet

public void assignFuzzySet(nrc.fuzzy.FuzzySet fuzzySet)
                    throws XValueOutsideUODException
Assigns a new FuzzySet to the FuzzyValue. Note that the linguistic expression is no longer valid and will be set to the DEFAULT_LE. Also NOTE that this method will likely be removed ... fuzzyValues should be created with constructors and the unary (modifiers) and binary (union, intersection etc.) supplied.

Parameters:
fuzzySet - the FuzzySet to be assigned.
Throws:
XValueOutsideUODException - if the fuzzy set x values are not within the range of the universe of discourse

fuzzyComplement

public nrc.fuzzy.FuzzyValue fuzzyComplement()
Takes the complement of the FuzzyValue. More specifically, it takes the compliment of the y values of the SetPoints of the FuzzySet. Mathematically (NOT), u(x) = 1 - u(x), or y = 1 - y.

This assumes that all of the membership values of the fuzzy set are <= 1.0 and >= 0.0. If values lie outside this then values >1.0 will be set to 0.0 and those < 0.0 will be set to 1.0

Returns:
a new FuzzyValue object that represents the complement of this FuzzyValue.

fuzzyScale

public nrc.fuzzy.FuzzyValue fuzzyScale(double y)
Scale this FuzzyValue. Returns the FuzzyValue which is scaled by:
    yvalue/maxYValueOfSet   
 

Effectively this adjusts the set so that the maximum membership value of the set has the value y and all other membership values are scaled accordingly. If the membership values are all less than y then a copy of the FuzzySet is returned (ie. it scales values down but never up).

Parameters:
y - scaling factor
Returns:
a newly constructed FuzzySet containing the scaled version of this FuzzySet

fuzzyNormalize

public nrc.fuzzy.FuzzyValue fuzzyNormalize()
                                    throws XValueOutsideUODException
Normalizes the FuzzyValue. Normalization involves identifying the point in the FuzzyValue with the highest membership value and multiplying all the membership values in the FuzzyValue by a scale factor such that this highest point then has a membership value of 1.0.

Returns:
a new FuzzyValue object that represents the normalization of this FuzzyValue.
Throws:
XValueOutsideUODException - if the fuzzy set x values are not within the range of the universe of discourse

getSupport

public nrc.fuzzy.IntervalVector getSupport()
Returns the support of this FuzzyValue. The support set of a FuzzyValue (FuzzySet) is the set of x values that have a membership value other than zero. Note that this is identical to a STRONG alpha cut with alpha value of 0.

Returns:
an IntervalVector object which represents the support set of this FuzzyValue.

getAlphaCut

public nrc.fuzzy.IntervalVector getAlphaCut(boolean cutType,
                                            double alpha)
Returns the alpha cut of the FuzzyValue at the membership level specified by the alpha argument. Formally, a distinction is made betweeen two types of alpha cuts, the strong and the weak alpha cut.

The alpha cut of a FuzzyValue (FuzzySet) is the set of all x values in the Universe of Discourse for which the membership value of the FuzzyValue (FuzzySet) is greater than (STRONG cut) or greater than or equal to (WEAK cut) the alpha argument.

Parameters:
cutType - Parameters.STRONG for a strong alpha cut or Parameters.WEAK for a weak alpha cut
alpha - the double membership value at which the alpha cut is taken. The resulting set is the set of all elements for which the membership value is greater than or equal to the alpha value.
Returns:
the IntervalVector object which represents the alpha cut of this FuzzyValue at the double value of the alpha argument.

getMembership

public double getMembership(double x)
                     throws XValueOutsideUODException
Returns the membership value of the FuzzyValue at the specified x value.

Parameters:
x - the double x value at which the membership value requested will be interpolated
Returns:
the value -1.0 if the FuzzySet of this FuzzyValue has zero points; otherwise, the membership value of the FuzzySet interpolated at the given x value
Throws:
XValueOutsideUODException - if the x value passed to the method is outside the Universe of Discourse for this FuzzyValue (ie. for the FuzzyVariable to which this FuzzyValue belongs)

getXforMembership

public double getXforMembership(double m)
                         throws NoXValueForMembershipException
Returns the 1st X value with the specified membership value in the FuzzySet This is done by interpolation. Note that if there are multiple x values with this membership value then the only the 1st X value is returned.
Note that this is most often used to get the X value corresponding to a membership value in a FuzzySet that is strictly increasing from 0.0 to 1.0 or strictly decreasing from 1.0 to 0.0 (e.g. an SFuzzySet or a ZFuzzySet).

Returns:
the 1st X value of the FuzzySet with the specified membership value or exception if the set does not have this membership value
NoXValueForMembershipException

horizontalIntersection

public nrc.fuzzy.FuzzyValue horizontalIntersection(double y)
Returns the horizontal intersection of the FuzzyValue at the membership level specified by the y parameter. Please see the diagram below for a visual depiction. If y is < 0 then y is set to 0.

Parameters:
y - the y value with which the set is being intersected
Returns:
a new FuzzyValue object representing the horizontal intersection for the FuzzyValue with the y value argument

horizontalUnion

public nrc.fuzzy.FuzzyValue horizontalUnion(double y)
Returns the horizontal union of the FuzzySet at the membership level specified by the y parameter. Please see the diagram below for a visual depiction. If y is < 0 then y is set to 0.

Parameters:
y - the y value with which the set is being unioned
Returns:
a new FuzzySet object representing the horizontal union for the FuzzySet with the y value argument

fuzzyIntersection

public nrc.fuzzy.FuzzyValue fuzzyIntersection(java.lang.String linguisticExpression)
                                       throws InvalidLinguisticExpressionException,
                                              XValueOutsideUODException,
                                              IncompatibleFuzzyValuesException
Perform the fuzzy intersection of 2 fuzzy values. The fuzzy variables of the 2 fuzzy values must be the same or the operation is not valid. For a visual depiction of the intersection set and more information, please see the documentation for the FuzzySet method fuzzyIntersection(FuzzySet otherSet).

Parameters:
linguisticExpression - a linguistic expression that defines the other fuzzyValue to be used in the intersection operation.
Returns:
a new FuzzyValue that is the intersection of this FuzzyValue and the one passed as a parameter
Throws:
XValueOutsideUODException - if the fuzzy set x values are not within the range of the universe of discourse
IncompatibleFuzzyValuesException - if the fuzzy values do not have identical fuzzy variables the operation cannot be done
InvalidLinguisticExpressionException - if the linguistic expression is not valid

fuzzyIntersection

public nrc.fuzzy.FuzzyValue fuzzyIntersection(nrc.fuzzy.FuzzyValue otherValue)
                                       throws XValueOutsideUODException,
                                              IncompatibleFuzzyValuesException
Perform the fuzzy intersection of 2 fuzzy values. The fuzzy variables of the 2 fuzzy values must be the same or the operation is not valid. For a visual depiction of the intersection set and more information, please see the documentation for the FuzzySet method fuzzyIntersection(FuzzySet otherSet).

Parameters:
otherValue - the 2nd FuzzyValue for the operation
Returns:
a new FuzzyValue that is the intersection of this FuzzyValue and the one passed as a parameter
Throws:
XValueOutsideUODException - if the fuzzy set x values are not within the range of the universe of discourse
IncompatibleFuzzyValuesException - if the fuzzy values do not have identical fuzzy variables the operation cannot be done

fuzzyUnion

public nrc.fuzzy.FuzzyValue fuzzyUnion(java.lang.String linguisticExpression)
                                throws InvalidLinguisticExpressionException,
                                       XValueOutsideUODException,
                                       IncompatibleFuzzyValuesException
Perform the fuzzy union of 2 fuzzy values. The fuzzy variables of the 2 fuzzy values must be the same or the operation is not valid. For a visual depiction of the union and more information, please see the documentation for the FuzzySet method fuzzyUnion(FuzzySet otherSet).

Parameters:
linguisticExpression - a linguistic expression that defines the other fuzzyValue to be used in the union operation.
Returns:
a new FuzzyValue that is the union of this FuzzyValue and the one passed as a parameter
Throws:
XValueOutsideUODException - if the fuzzy set x values are not within the range of the universe of discourse
IncompatibleFuzzyValuesException - if the fuzzy values do not have identical fuzzy variables the operation cannot be done
InvalidLinguisticExpressionException - if the linguistic expression is not valid

fuzzyUnion

public nrc.fuzzy.FuzzyValue fuzzyUnion(nrc.fuzzy.FuzzyValue otherValue)
                                throws XValueOutsideUODException,
                                       IncompatibleFuzzyValuesException
Perform the fuzzy union of 2 fuzzy values. The fuzzy variables of the 2 fuzzy values must be the same or the operation is not valid. For a visual depiction of the union and more information, please see the documentation for the FuzzySet method fuzzyUnion(FuzzySet otherSet).

Parameters:
otherValue - the 2nd FuzzyValue for the operation
Returns:
a new FuzzyValue that is the union of this FuzzyValue and the one passed as a parameter
Throws:
XValueOutsideUODException - if the fuzzy set x values are not within the range of the universe of discourse
IncompatibleFuzzyValuesException - if the fuzzy values do not have identical fuzzy variables the operation cannot be done

fuzzySum

public nrc.fuzzy.FuzzyValue fuzzySum(java.lang.String linguisticExpression)
                              throws InvalidLinguisticExpressionException,
                                     XValueOutsideUODException,
                                     IncompatibleFuzzyValuesException
Returns the sum of this FuzzyValue with the FuzzyValue argument. The sum of 2 fuzzy sets is a set where the membership (y) value at every x position is the sum of the memberships values of the two sets at the corresponding x values.
The fuzzy variables of the 2 fuzzy values must be the same or the operation is not valid.

NOTE WELL: The sum can lead to FuzzySets with membership values greater than 1.0. This is sometimes used to collect output of fuzzy rules (global contribution) rather than doing the union.

Parameters:
linguisticExpression - a linguistic expression that defines the other fuzzyValue to be used in the sum operation.
Returns:
a new FuzzyValue that is the sum of this FuzzyValue and the one passed as a parameter
Throws:
XValueOutsideUODException - if the fuzzy set x values are not within the range of the universe of discourse
IncompatibleFuzzyValuesException - if the fuzzy values do not have identical fuzzy variables the operation cannot be done
InvalidLinguisticExpressionException - if the linguistic expression is not valid

fuzzySum

public nrc.fuzzy.FuzzyValue fuzzySum(nrc.fuzzy.FuzzyValue otherValue)
                              throws XValueOutsideUODException,
                                     IncompatibleFuzzyValuesException
Returns the sum of this FuzzyValue with the FuzzyValue argument. The sum of 2 fuzzy sets is a set where the membership (y) value at every x position is the sum of the memberships values of the two sets at the corresponding x values.
The fuzzy variables of the 2 fuzzy values must be the same or the operation is not valid.

NOTE WELL: The sum can lead to FuzzySets with membership values greater than 1.0. This is sometimes used to collect output of fuzzy rules (global contribution) rather than doing a union.

Parameters:
otherValue - the 2nd FuzzyValue for the sum operation.
Returns:
a new FuzzyValue that is the sum of this FuzzyValue and the one passed as a parameter
Throws:
XValueOutsideUODException - if the fuzzy set x values are not within the range of the universe of discourse
IncompatibleFuzzyValuesException - if the fuzzy values do not have identical fuzzy variables the operation cannot be done

maximumOfIntersection

public double maximumOfIntersection(java.lang.String linguisticExpression)
                             throws InvalidLinguisticExpressionException,
                                    IncompatibleFuzzyValuesException
Find the minimum membership values between 2 FuzzyValues at all x values and then find the maximum of these minimums (in effect take the intersection of the 2 FuzzyValues and find the maximum membership value of this).

Parameters:
linguisticExpression - a linguistic expression that defines the other fuzzyValue to be compared to this FuzzyValue
Returns:
the maximum membership value of the intersection between the 2 FuzzyValues
Throws:
InvalidLinguisticExpressionException - if the linguistic expression is not valid
IncompatibleFuzzyValuesException - if the fuzzy values do not have identical fuzzy variables the operation cannot be done

maximumOfIntersection

public double maximumOfIntersection(nrc.fuzzy.FuzzyValue otherValue)
                             throws IncompatibleFuzzyValuesException
Find the minimum membership values between 2 FuzzyValues at all x values and then find the maximum of these minimums (in effect take the intersection of the 2 FuzzyValues and find the maximum membership value of this).

Parameters:
otherValue - the 2nd FuzzyValue for the operation
Returns:
the maximum membership value of the intersection between the 2 FuzzyValues
Throws:
IncompatibleFuzzyValuesException - if the fuzzy values do not have identical fuzzy variables the operation cannot be done

momentDefuzzify

public double momentDefuzzify()
                       throws InvalidDefuzzifyException,
                              XValuesOutOfOrderException
Moment defuzzification defuzzifies a fuzzy set returning a floating point (double value) that represents the fuzzy set. It calculates the first moment of area of a fuzzy set about the y axis. The set is subdivided into different shapes by partitioning vertically at each point in the set, resulting in rectangles, triangles, and trapezoids. The centre of gravity (moment) and area of each subdivision is calculated using the appropriate formulas for each shape. The first moment of area of the whole set is then:
      sum of ( moment(i) * area(i) )          <-- top
      ------------------------------
          sum of (area(i))                    <-- bottom
  
If the total area is 0 then throw an exception since the moment is not defined.

Returns:
the floating value that is the first moment of the fuzzy set
Throws:
InvalidDefuzzifyException - there is no valid moment for the fuzzy set (generally the area is 0 under the fuzzy set graph)
XValuesOutOfOrderException - occurs when the MinUOD is greater than or equal to the MaxUOD parameter (this should never happen).

weightedAverageDefuzzify

public double weightedAverageDefuzzify()
                                throws XValuesOutOfOrderException,
                                       InvalidDefuzzifyException
Finds the weighted average of the values of a fuzzy set as the defuzzification value. This is slightly different than the maximumDefuzzify since tha maximumDefuzzify uses only points that have the same membership value (the one that is the maximum in the set of points). The weightedAverageDefuzzify uses all of the points with non-zero membership values and calculates the average of the x values using the membership values as weights in this average. NOTE: This doesn't always work well because there can be x ranges where the y value is constant at the max value and other places where the max is only reached for a single x value. When this happens the single value gets too much of a say in the defuzzified value. So use moment defuzzify in cases like this.
             /------\                   /\
            /        \                 /  \
         --/          \---------------/    \-------------
                 ^       ^
                 |       |
                 |       | gives this as the weighted average
                 | this is more reasonable???

 
However, it is especially effective if the output has a number of singleton points in it. This might be, for example, when one has only singleton values describing the output fuzzy values (Takagi-Sugeno-Kang zero order type rules). In this case one gets a result that would be expected and one that would result in an exception with the momentDefuzzify (area is 0) and a poor result with the maximumDefuzzify (since only the values with the max membership are used - 20 in the example below).
    
      1.0                 |
                          |
      0.5        |        |
                 |        |        |
         --------|--------|--------|--------
         0      10        20       30      40
                        ^
                        |
                        | gives 18.57 as the weighted average   
 
      (10*0.5 + 20*1 + 30*0.25) / (0.5 + 1 + 0.25) = 18.57

 
Centre of gravity (moment) defuzzify is likely more useful most of the time.

Returns:
the floating value that is the weighted average of the fuzzy set
Throws:
InvalidDefuzzifyException - there are no points in the FuzzySet
XValuesOutOfOrderException - occurs when the MinUOD is greater than or equal to the MaxUOD parameter (this should never happen).

maximumDefuzzify

public double maximumDefuzzify()
                        throws XValuesOutOfOrderException,
                               InvalidDefuzzifyException
Finds the mean of maxima of a fuzzy set as the defuzzification value. NOTE: This doesn't always work well because there can be x ranges where the y value is constant at the max value and other places where the max is only reached for a single x value. When this happens the single value gets too much of a say in the defuzzified value. So use moment defuzzify in cases like this.
             /------\                   /\
            /        \                 /  \
         --/          \---------------/    \-------------
                 ^       ^
                 |       |
                 |       | gives this as the mean of maximum
                 | this is more reasonable???

 
Centre of gravity (moment) defuzzify is likely more useful most of the time.

Returns:
the floating value that is the mean of the maximum values of the fuzzy set
Throws:
InvalidDefuzzifyException - there are no points in the FuzzySet
XValuesOutOfOrderException - occurs when the MinUOD is greater than or equal to the MaxUOD parameter (this should never happen).

fuzzyMatch

public boolean fuzzyMatch(java.lang.String linguisticExpression)
                   throws InvalidLinguisticExpressionException,
                          IncompatibleFuzzyValuesException
Determine if 2 FuzzyValues 'match' or intersect with a membership of at least that specified by the FuzzyValue class variable matchThreshold.

Parameters:
linguisticExpression - a linguistic expression that defines the other fuzzyValue to be compared to this FuzzyValue
Returns:
true if the fuzy values overlap else false
Throws:
InvalidLinguisticExpressionException - if the linguistic expression is not valid
IncompatibleFuzzyValuesException - if the fuzzy values do not have identical fuzzy variables the operation cannot be done

fuzzyMatch

public boolean fuzzyMatch(java.lang.String linguisticExpression,
                          double threshold)
                   throws InvalidLinguisticExpressionException,
                          IncompatibleFuzzyValuesException
Determine if 2 FuzzyValues 'match' or intersect with a membership of at least that specified by parameter 'threshold'. The threshold is restricted to a value between 0 and 1.

Parameters:
threshold - determines the value above which a match is considered to be true, over-riding the class variable matchThreshold value.
Returns:
true if the fuzy values overlap else false
Throws:
InvalidLinguisticExpressionException - if the linguistic expression is not valid
IncompatibleFuzzyValuesException - if the fuzzy values do not have identical fuzzy variables the operation cannot be done

fuzzyMatch

public boolean fuzzyMatch(nrc.fuzzy.FuzzyValue otherValue)
                   throws IncompatibleFuzzyValuesException
Determine if 2 FuzzyValues 'match' or intersect with a membership of at least that specified by the FuzzyValue class variable matchThreshold. The threshold is restricted to a value between 0 and 1.

Parameters:
otherValue - the 2nd FuzzyValue for the operation
Returns:
true if the fuzy values overlap else false
Throws:
IncompatibleFuzzyValuesException - if the fuzzy values do not have identical fuzzy variables the operation cannot be done

fuzzyMatch

public boolean fuzzyMatch(nrc.fuzzy.FuzzyValue otherValue,
                          double threshold)
                   throws IncompatibleFuzzyValuesException
Determine if 2 FuzzyValues 'match' or intersect with a membership of at least that specified by parameter threshold. The threshold is restricted to a value between 0 and 1.

Parameters:
otherValue - the 2nd FuzzyValue for the operation.
threshold - determines the value above which a match is considered to be true, over-riding the class variable matchThreshold value.
Returns:
true if the fuzy values overlap else false
Throws:
IncompatibleFuzzyValuesException - if the fuzzy values do not have identical fuzzy variables the operation cannot be done

similarity

public double similarity(nrc.fuzzy.FuzzyValue fv)
                  throws IncompatibleFuzzyValuesException
SIMILARITY: similarity measure of two fuzzy sets Given two fuzzy values, f1 and f2, similarity is defined as:
 similarity = if    necessity(f1,f2) > 0.5   
              then  possibility(f1,f2)   
              else  (necessity(f1,f2) + 0.5) * possibility(f1,f2) 

 and 

   necessity(f1,f2) = 1 - possibility(not f1,f2)

 and

   possibility(f1,f2) = max(min(u  (x),u  (x)) 
                         x       f1     f2  
 

Note: we must check that the 2 fuzzy values have the same Fuzzy variable

Parameters:
fv - the fuzzy value with which this fuzzy value is compared
Returns:
The necessity value for the 2 fuzzy values
Throws:
IncompatibleFuzzyValuesException - if the fuzzy values do not have identical fuzzy variables the operation cannot be done

setConfineFuzzySetsToUOD

public static void setConfineFuzzySetsToUOD(boolean b)
If param is true FuzzySets will be confined to lie within the Universe of Discourse (UOD) when FuzzyValues are constructed. Normally this is false.

Parameters:
b - true if f FuzzySets will be confined to lie within the UOD when constructing FuzzyValues.

isConfineFuzzySetsToUOD

public static boolean isConfineFuzzySetsToUOD()
Returns true if FuzzySets will be confined to lie within the Universe of Discourse (UOD) when FuzzyValues are constructed. Normally this is false.

Returns:
true if f FuzzySets will be confined to lie within the UOD when constructing FuzzyValues.

isEmpty

public boolean isEmpty()
Returns true if this FuzzyValue is empty; in other words, if this FuzzyValue has a null FuzzySet, or a FuzzySet which doesn't contain any points.

Returns:
true if this FuzzyValue is empty

isConvex

public boolean isConvex()
Returns true if this FuzzyValue is convex. The definition of convex is that the membership function of a convex FuzzyValue (FuzzySet) does not go "up-and-down" more than once.

Returns:
true if this FuzzyValue is convex

isNormal

public boolean isNormal()
Returns true if this FuzzyValue is normal. The definition of normal is that there is at least one point in the universe of discourse where the membership function reaches unity (in terms of this fuzzy package, unity is equal to 1.0).

Returns:
true if this FuzzyValue is normal

size

public int size()
Returns the size of the FuzzyValue; in other words, the number of points contained in the FuzzySet.

Returns:
the int value specifying the size of the FuzzyValue, or the number of points contained in the FuzzyValue.

getX

public double getX(int index)
Returns the x value of the point in the FuzzyValue at the specified index. As usual, the indices begin at 0, so the x value of the first point in the FuzzyValue can be accessed with the following method call: fuzzyValueInstanceName.getX(0)

Parameters:
index - the 0 based index into the fuzzy set points of the fuzzy value.
Returns:
the double x value of the point in the FuzzyValue at the specified index.

getY

public double getY(int index)
Returns the y value of the point in the FuzzyValue at the specified index. As usual, the indices begin at 0, so the y value of the first point in the FuzzyValue can be accessed with the following method call: fuzzyValueInstanceName.getY(0)

Parameters:
index - the 0 based index into the fuzzy set points of the fuzzy value.
Returns:
the double y value of the point in the FuzzyValue at the specified index.

getMaxY

public double getMaxY()
Returns the maximum membership value of the FuzzySet.

Returns:
the double value representing the maximum membership value of the FuzzySet

getMinY

public double getMinY()
Returns the minimum membership value of the FuzzySet.

Returns:
the double value representing the minimum membership value of the FuzzySet

toString

public java.lang.String toString()
Returns the String representation of the FuzzyValue.

For example:

 FuzzyVariable         -> TEMPERATURE [0, 60] Degree Celsius
 Linguistic Expression -> HOT 
 FuzzySet              -> { 0/30 1/45 0/60}
 

Overrides:
toString in class java.lang.Object
Returns:
the String representation of the FuzzyValue

getFuzzyVariable

public nrc.fuzzy.FuzzyVariable getFuzzyVariable()
Returns the FuzzyVariable to which this FuzzyValue belongs.

Returns:
the FuzzyVariable to which this FuzzyValue belongs, and within whose whose definition the FuzzyValue has meaning.

getFuzzySet

public nrc.fuzzy.FuzzySet getFuzzySet()
Returns the FuzzySet that is contained within this FuzzyValue.

Returns:
the FuzzySet belonging to this FuzzyValue

getUnits

public java.lang.String getUnits()
Returns the units of the FuzzyVariable to which this FuzzyValue belongs, and therefore the units of this FuzzyValue.

Returns:
the String value that represents the units of this FuzzyValue.

getMinUOD

public double getMinUOD()
Returns the x value which represents the minimum x value in the Universe of Discourse of the FuzzyVariable to which this FuzzyValue belongs, and therefore the mininum x value of the Universe of Discourse of this FuzzyValue.


getMaxUOD

public double getMaxUOD()
Returns the x value which represents the maximum x value in the Universe of Discourse of the FuzzyVariable to which this FuzzyValue belongs, and therefore the maxinum x value of the Universe of Discourse of this FuzzyValue.


setLinguisticExpression

public void setLinguisticExpression(java.lang.String lexpr)
Sets the String which represents the linguistic expression of this FuzzyValue. Note: be careful when using this since the expression should be a true representation for the FuzzyValue. A common place to use this might be if a FuzzyValue is created with no linguistic expression (using a specified Fuzzyset for example) and the user wanted to add one for that FuzzySet.

Parameters:
lexpr - the linguistic expression to replace the current one

getLinguisticExpression

public java.lang.String getLinguisticExpression()
Returns the String which represents the linguistic expression of this FuzzyValue.

Returns:
the String which represents the linguistic expression of this FuzzyValue.

isAnyXValueOutsideUOD

public boolean isAnyXValueOutsideUOD(nrc.fuzzy.FuzzySet fs,
                                     nrc.fuzzy.FuzzyVariable fvar)
Checks to see if all of the X values of a fuzzy set are within the range of the universe of discourse (UOD) of a fuzzy variable.

Parameters:
fs - the fuzzy set to be checked
fvar - the fuzzy variable with the UOD definition
Returns:
true if any X value is outside of the UOD range.

isXValueOutsideUOD

public boolean isXValueOutsideUOD(double x,
                                  nrc.fuzzy.FuzzyVariable fvar)
Returns true if the x value passed to the method is outside of the Universe of Discourse.

Parameters:
x - the x value being tested to be within the range of the UOD
fvar - the fuzzy variable that defines the UOD
Returns:
true if the x value argument passed is outside of the Universe of Discourse.

getMatchThreshold

public static double getMatchThreshold()
Returns the current matchThreshold which is used when comparing fuzzy values with the fuzzyMatch method.

Returns:
the matchThreshold.

setMatchThreshold

public static void setMatchThreshold(double value)
Sets the current default matchThreshold which is used when comparing fuzzy values with the fuzzyMatch method.

Parameters:
value - the new value for matchThreshold. If the value is > 1.0 set it to 1.0; if it is < 0.0 set it to 0.0.

plotFuzzyValue

public java.lang.String plotFuzzyValue(java.lang.String plotChar,
                                       double lowX,
                                       double highX)
Plots the fuzzy value in an ascii format producing a String that can be displayed. The string must be displayed using a non-proportional spaced font. Consider the following example:

   FuzzyValue fval;
   FuzzyVariable temp = new FuzzyVariable("temperature", 0, 100, "C");
     ...
   fval = new FuzzyValue(temp, "very hot or cold");
   System.out.println(fval.plotFuzzyValue("+", 0, 40));
   
 will display 

   Fuzzy Value: temperature
   Linguistic Value: very hot or cold (+)
   
    1.00+++++++                                     +++++++
    0.95       +
    0.90                                           +
    0.85        +
    0.80         +
    0.75                                          +
    0.70          +
    0.65
    0.60           +                             +
    0.55            +
    0.50                                        +
    0.45             +
    0.40              +                        +
    0.35
    0.30               +                      +
    0.25
    0.20                +                    +
    0.15                 +                  +
    0.10                                   +
    0.05                  +               +
    0.00                   +++++++++++++++
        |----|----|----|----|----|----|----|----|----|----|
       0.00      8.00     16.00     24.00     32.00     40.00


plotFuzzyValue

public java.lang.String plotFuzzyValue(java.lang.String plotChar)
Plots the fuzzy value in an ascii format producing a String that can be displayed. The string must be displayed using a non-proportional spaced font. The low X and high X values of the plot are upper and lower values of the universe of discourse for the FuzzyValue.

See plotFuzzyValue( String plotChars, double lowX, double highX ) for an example.


plotFuzzyValues

public static java.lang.String plotFuzzyValues(java.lang.String plotChars,
                                               nrc.fuzzy.FuzzyValue[] fvals)
Plots the given fuzzy values in an ascii format producing a String that can be displayed. The string must be displayed using a non-proportional spaced font. The low X and high X values of the plot are upper and lower values of the universe of discourse for the FuzzyValues. The string of plotting characters are used in sequence to plot the corresponding fuzzy value. If the string is empty the character '*' is used. If the string has fewer characters than fuzzy values, the last character is reused. All FuzzyValues must be from the same FuzzyVariable.

See plotFuzzyValues( String plotChars, double lowX, double highX, FuzzyValue fvals[]) for an example.

Parameters:
plotChars - characters to use for plotting (normally *, +, ., etc)

plotFuzzyValues

public static java.lang.String plotFuzzyValues(java.lang.String plotChars,
                                               double lowX,
                                               double highX,
                                               nrc.fuzzy.FuzzyValue[] fvals)
Plots the fuzzy values in an ascii format producing a String that can be displayed. The string must be displayed using a non-proportional spaced font. The string of plotting characters are used in sequence to plot the corresponding fuzzy value. If the string is empty the character '*' is used. If the string has fewer characters than fuzzy values, the last character is reused. All FuzzyValues must be from the same FuzzyVariable. Consider the following example:

   FuzzyValue fval2, fval3;
   FuzzyValue fvals[] = new FuzzyValue[2];
   FuzzyVariable temp = new FuzzyVariable("temperature", 0, 100, "C");
     ...
   fval2 = new FuzzyValue(temp, "very hot or cold");
   fval3 = new FuzzyValue(temp, "medium");
   fvals[0] = fval2;
   fvals[1] = fval3;
   System.out.println(FuzzyValue.plotFuzzyValues("*+", 0, 40, fvals));
   
 will display 

   Fuzzy Value: temperature
   Linguistic Value: very hot or cold (*),  medium (+)
   
    1.00*******            +++++++++++++            *******
    0.95       *          +             +
    0.90                                           *
    0.85        *        +               +
    0.80         *      +                 +
    0.75                                          *
    0.70          *    +                   +
    0.65
    0.60           *  +                     +    *
    0.55            *+                       +
    0.50                                        *
    0.45            +*                        +
    0.40           +  *                        +
    0.35
    0.30          +    *                      * +
    0.25
    0.20         +      *                    *   +
    0.15        +        *                  *     +
    0.10                                   *
    0.05       +          *               *        +
    0.00+++++++            ***************          +++++++
        |----|----|----|----|----|----|----|----|----|----|
       0.00      8.00     16.00     24.00     32.00     40.00 
 

Parameters:
plotChars - characters to use for plotting (normally *, +, ., etc)